package projetstackoverflow

import org.springframework.dao.DataIntegrityViolationException

class TagController {
	
	static scaffold = true
	
	def list(Integer max) {
		params.max = 8
		def offset = 0
		if(params.offset)
			offset = Integer.valueOf(params.offset)
		def tagInstanceList = Tag.findAll("from Tag as t order by size(t.questions) desc", [ max: params.max, offset:offset])
		def total = Tag.count()
		[tagInstanceList:tagInstanceList, tagInstanceTotal: total]
	}
}
